/* Define to prevent recursive inclusion -------------------------------------*/
#ifndef __ARDUINO_H
#define __ARDUINO_H

#ifdef __cplusplus
extern "C" {
#endif

/* Includes ------------------------------------------------------------------*/
#include <stm32f0xx.h>

/* Exported types ------------------------------------------------------------*/
typedef struct {
    uint32_t baudRate;
    void (*begin)(uint32_t);
    uint16_t (*available)(void);
    void (*flush)(void);
    char (*read)(void);
    char (*peek)(void);
    void (*write)(uint8_t);
    void (*print)(char*);
    void (*println)(char*);  
} Serial_TypeDef;

extern Serial_TypeDef Serial;

/* Exported constants --------------------------------------------------------*/
#define	OUTPUT	1
#define INPUT	0
	
#define HIGH	1
#define	LOW		0
	
/* Exported macro ------------------------------------------------------------*/
/* Exported functions ------------------------------------------------------- */
void platform_config(void);

void pinMode(uint8_t, int);
void digitalWrite(uint8_t, int);
int digitalRead(uint8_t);
int analogRead(uint8_t);
void analogWrite(uint8_t, uint16_t);
	 
uint32_t millis(void);
void delay(uint32_t);

void attachInterrupt(uint8_t, void (*)(void), int mode);
void detachInterrupt(uint8_t);

#ifdef __cplusplus
} // extern "C"
#endif

#endif // __ARDUINO_H
